-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[VAULTS] Simplify beacon chain deposit processing #925
Conversation
a54716a
to
cfef66c
Compare
Hardhat Unit Tests Coverage Summary
Diff against master
Results for commit: b12a322 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
@@ -0,0 +1,16 @@ | |||
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// SPDX-FileCopyrightText: 2024 Lido <[email protected]> | |
// SPDX-FileCopyrightText: 2025 Lido <[email protected]> |
|
||
_makeBeaconChainDeposits32ETH(_numberOfDeposits, bytes.concat(withdrawalCredentials()), _pubkeys, _signatures); | ||
emit DepositedToBeaconChain(msg.sender, _numberOfDeposits, _numberOfDeposits * 32 ether); | ||
emit DepositedToBeaconChain(msg.sender, numberOfDeposits); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't a total deposited amount be needed for analytics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've decided not to include the total amount because each individual amount is included in the DepositContract's DepositEvent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not an expert, but wouldn't it be more convenient for analytics / UI to receive it as only one event instead of many? Just from this angle.
@@ -460,3 +475,27 @@ describe("Scenario: Staking Vaults Happy Path", () => { | |||
expect(await stakingVault.locked()).to.equal(0); | |||
}); | |||
}); | |||
|
|||
function getRoot(creds: string, pubkey: string, signature: string, size: bigint) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplication, move to lib?
42fd97b
to
71e93b2
Compare
bytes32 sigSlice2Root = sha256(abi.encodePacked(_signature[64:], bytes32(0))); | ||
bytes32 signatureRoot = sha256(abi.encodePacked(sigSlice1Root, sigSlice2Root)); | ||
|
||
// Step 5. Compute the root-toot-toorootoo of the deposit data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Step 5. Compute the root-toot-toorootoo of the deposit data | |
// Step 5. Compute the root-toot-totoro of the deposit data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌱
This PR gets rid of intense gas optimization for deposits in favor of simplicity and readability thanks to the Pectra's MAX_EB increase.